From cd082ee2d3f6315f5024a33e1a03404a31b16c0e Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Mon, 21 Nov 2005 19:08:27 +0100 Subject: [PATCH] Misc fixes for breakage when moving to new Python/C interface style. Signed-off-by: Ewan Mellor --- tools/python/xen/lowlevel/xc/xc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 0b5f0b32a2..c63968f424 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1061,14 +1061,14 @@ static PyObject *PyXc_getattr(PyObject *obj, char *name) return Py_FindMethod(pyxc_methods, obj, name); } -static PyObject *PyXc_new(PyTypeObject *type, PyObject *args) +static PyObject *PyXc_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { XcObject *self = (XcObject *)type->tp_alloc(type, 0); if (self == NULL) return NULL; - self->xc_handle = NULL; + self->xc_handle = -1; return (PyObject *)self; } @@ -1086,9 +1086,9 @@ PyXc_init(XcObject *self, PyObject *args, PyObject *kwds) static void PyXc_dealloc(XcObject *self) { - if (self->xc_handle) { + if (self->xc_handle != -1) { xc_interface_close(self->xc_handle); - self->xc_handle = NULL; + self->xc_handle = -1; } self->ob_type->tp_free((PyObject *)self); @@ -1145,7 +1145,7 @@ PyMODINIT_FUNC initxc(void) if (PyType_Ready(&PyXcType) < 0) return; - m = Py_InitModule(PKG, PyXc_methods); + m = Py_InitModule(PKG, xc_methods); if (m == NULL) return; -- 2.30.2